<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>layuiAdmin 控制台主页一</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="/layuiadmin/layui/css/layui.css"
	media="all">
<link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
</head>
<body>

	<div class="layui-fluid">
		<div class="layui-row layui-col-space15">
			<div class="layui-col-md8">
				<div class="layui-row layui-col-space15">
					<div class="layui-col-md6">
						<div class="layui-card">
							<div class="layui-card-header">快捷方式</div>
							<div class="layui-card-body">

								<div class="layui-carousel layadmin-carousel layadmin-shortcut">
									<div carousel-item>
										<ul class="layui-row layui-col-space10">
											<li class="layui-col-xs3"><a
												lay-href="home/homepage1.html"> <i
													class="layui-icon layui-icon-console"></i> <cite>主页一</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="home/homepage2.html"> <i
													class="layui-icon layui-icon-chart"></i> <cite>主页二</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="component/layer/list.html"> <i
													class="layui-icon layui-icon-template-1"></i> <cite>弹层</cite>
											</a></li>
											<li class="layui-col-xs3"><a layadmin-event="im"> <i
													class="layui-icon layui-icon-chat"></i> <cite>聊天</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="component/progress/index.html"> <i
													class="layui-icon layui-icon-find-fill"></i> <cite>进度条</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="app/workorder/list.html"> <i
													class="layui-icon layui-icon-survey"></i> <cite>工单</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="user/user/list.html"> <i
													class="layui-icon layui-icon-user"></i> <cite>用户</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="set/system/website.html"> <i
													class="layui-icon layui-icon-set"></i> <cite>设置</cite>
											</a></li>
										</ul>
										<ul class="layui-row layui-col-space10">
											<li class="layui-col-xs3"><a
												lay-href="set/user/info.html"> <i
													class="layui-icon layui-icon-set"></i> <cite>我的资料</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="set/user/info.html"> <i
													class="layui-icon layui-icon-set"></i> <cite>我的资料</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="set/user/info.html"> <i
													class="layui-icon layui-icon-set"></i> <cite>我的资料</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="set/user/info.html"> <i
													class="layui-icon layui-icon-set"></i> <cite>我的资料</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="set/user/info.html"> <i
													class="layui-icon layui-icon-set"></i> <cite>我的资料</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="set/user/info.html"> <i
													class="layui-icon layui-icon-set"></i> <cite>我的资料</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="set/user/info.html"> <i
													class="layui-icon layui-icon-set"></i> <cite>我的资料</cite>
											</a></li>
											<li class="layui-col-xs3"><a
												lay-href="set/user/info.html"> <i
													class="layui-icon layui-icon-set"></i> <cite>我的资料</cite>
											</a></li>
										</ul>

									</div>
								</div>

							</div>
						</div>
					</div>
					<div class="layui-col-md6">
						<div class="layui-card">
							<div class="layui-card-header">待办事项</div>
							<div class="layui-card-body">

								<div class="layui-carousel layadmin-carousel layadmin-backlog">
									<div carousel-item>
										<ul class="layui-row layui-col-space10">
											<li class="layui-col-xs6"><a
												lay-href="app/content/comment.html"
												class="layadmin-backlog-body">
													<h3>待审评论</h3>
													<p>
														<cite>66</cite>
													</p>
											</a></li>
											<li class="layui-col-xs6"><a
												lay-href="app/forum/list.html" class="layadmin-backlog-body">
													<h3>待审帖子</h3>
													<p>
														<cite>12</cite>
													</p>
											</a></li>
											<li class="layui-col-xs6"><a
												lay-href="template/goodslist.html"
												class="layadmin-backlog-body">
													<h3>待审商品</h3>
													<p>
														<cite>99</cite>
													</p>
											</a></li>
											<li class="layui-col-xs6"><a href="javascript:;"
												onclick="layer.tips('不跳转', this, {tips: 3});"
												class="layadmin-backlog-body">
													<h3>待发货</h3>
													<p>
														<cite>20</cite>
													</p>
											</a></li>
										</ul>
										<ul class="layui-row layui-col-space10">
											<li class="layui-col-xs6"><a href="javascript:;"
												class="layadmin-backlog-body">
													<h3>待审友情链接</h3>
													<p>
														<cite style="color: #FF5722;">5</cite>
													</p>
											</a></li>
										</ul>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="layui-col-md12">
						<div class="layui-card">
							<div class="layui-card-header">数据概览</div>
							<div class="layui-card-header">此表只显示7天订单数据</div>	
								<div class="layui-inline">
									<label class="layui-form-label">时间范围</label>
									<div class="layui-input-inline">
											<input type="text" class="layui-input" id="test10"
												placeholder=" - ">
									</div>
								</div>
								<div class="layui-card-body">
									<div id="main" style="width: 700px; height: 400px;"></div>
								</div>
						</div>
					</div>
				</div>


				</div>

			</div>
		</div>
		<script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.0.0-alpha.1/echarts.common.js"></script>
		<script src="/layuiadmin/layui/layui.js"></script>
		<script type="text/javascript">
			layui.config({
				base : '/layuiadmin/' //静态资源所在路径
			}).extend({
				index : 'lib/index' //主入口模块
			}).use([ 'index', 'console', 'laydate', 'form' ], function() {
				var laydate = layui.laydate;
				var form = layui.form;
				 var $ = layui.$;
				laydate.render({
					elem : '#test10',
					type : 'datetime',
					range : true,
					done: function(value, date, endDate){
						$.ajax({
							url:"/orderbytime",
							type:"get",
							data:{
								date:value
							},
							dataType:"json",
							success:function(res){
								
							}
						})
				        alert(value); //得到日期生成的值，如：2017-08-18
				      }
				});
				$.ajax({
					 url:"/orderall",
					 type:"get",
					 dataType:"json",
					 success:function(res){
						 var datas = res.data;
						myChart.setOption({
							xAxis:{
								data:datas.map(a => a.date)
							},
							series:[{
								name:"订单数量",
								data:datas.map(a => a.count)
							}]
						})
					 }
				 })
				var myChart = echarts.init(document.getElementById('main'));
				
				// 指定图表的配置项和数据
				var option = {
					title : {
						text : '订单变化'
					},
					tooltip : {},
					legend : {
						data : [ '订单数量' ]
					},
					xAxis : {
						data : [  ]
					},
					yAxis : {},
					series : [ {
						name : '订单数量',
						type : 'line',
						data : [1,2,3 ]
					} ]
				};

				// 使用刚指定的配置项和数据显示图表。
				myChart.setOption(option);
			});
		</script>
		
</body>
</html>

